class CategorysMgrController {

    def list = {
        params.max = Math.min(params.max ? params.int('max') : 20, 100)
        params.sort = 'sequencer'
        params.order = 'asc'
        if (params.id && params.id != "") {
            def parent = Categorys.get(params.id)
             ['parent' : parent ,
             categorysInstanceList: Categorys.findAllBySchoolAndParent(session.school ,parent ,params) ]
        }else{
            [categorysInstanceList: Categorys.findAllBySchoolAndParentIsNull(session.school , params) ]
        }
    }
}
